package BFS_125;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;





public class Solution {

	public List<List<String>> ladderLength(String beginWord, String endWord, List<String> wordList) {
		int L = beginWord.length();

		Map<String, List<String>> allDict = new HashMap<String, List<String>>();

		wordList.forEach(word -> {
			for (int i = 0; i < L; i++) {
				String newWord = word.substring(0,i)+'*'+word.substring(i+1,L);
				List<String> tranStrings = allDict.getOrDefault(newWord, new ArrayList<String>());
				tranStrings.add(word);
				allDict.put(newWord, tranStrings);
			}
		});
 

	}

}
